/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package wli.web.java.db;

import java.util.List;
import org.hibernate.Query;
import org.hibernate.Session;

/**
 *
 * @author liw
 */
public class AccountHelper {

    Session session = null;

    public AccountHelper() {
        this.session = HibernateUtil.getSessionFactory().getCurrentSession();
    }

    public List getRolesList() {
        List<Roles> roleList = null;
        try {
            org.hibernate.Transaction tx = session.beginTransaction();
            Query q = session.createQuery("from roles");
            roleList = (List<Roles>) q.list();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return roleList;
    }
}
